package com.mmlc.meimei.lichengkongjian.Adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.mmlc.meimei.lichengkongjian.App;
import com.mmlc.meimei.lichengkongjian.R;
import com.mmlc.meimei.lichengkongjian.been.AllOrderBean;

import org.xutils.x;

import java.util.List;

public class ActivityMuchOrderAdapter extends BaseAdapter {

    ViewGroup viewGroup;
    List<AllOrderBean> item;

    public ActivityMuchOrderAdapter(ViewGroup viewGroup, List<AllOrderBean> item) {
        this.viewGroup = viewGroup;
        this.item = item;
    }

    @Override
    public int getCount() {
        return item.size();
    }

    @Override
    public Object getItem(int i) {
        return item.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(final int i, View view, ViewGroup viewGroup) {
        if (view == null) {
            view = App.layoutInflater.inflate(R.layout.adapter_waitsend, viewGroup, false);
        }
        AllOrderBean bean = item.get(i);

        ImageView iv_photo = (ImageView) view.findViewById(R.id.iv_photo);
        x.image().bind(iv_photo, bean.photoUrl);

        TextView tv_orderNumber = (TextView) view.findViewById(R.id.tv_orderNumber);
        tv_orderNumber.setText(bean.orderNumber);

        TextView tv_shopInfo = (TextView) view.findViewById(R.id.tv_shopInfo);
        tv_shopInfo.setText(bean.shopInfo);

        TextView tv_shopColor = (TextView) view.findViewById(R.id.tv_shopColor);
        tv_shopColor.setText(bean.shopColor);

        TextView tv_shopMoney = (TextView) view.findViewById(R.id.tv_shopMoney);
        tv_shopMoney.setText(bean.shopPrice);

        return view;
    }
}

